Sine and Cosine Rule

Sine Rule

For a given triangle ABC:

Row[{Graphics[{Thick,White,EdgeForm[Thickness[0.01]],Polygon[{{0,0},{5,0},{3,4}}],Blue,Style[Text["A",{3,4.2}],FontSize->20],Style[Text["B",{-0.3,0}],FontSize->20],Style[Text["C",{5.2,0}],FontSize->20],Style[Text["a",{2.5,-0.2}],FontSize->16],Style[Text["b",{4.2,2.1}],FontSize->16],Style[Text["c",{1.4,2.3}],FontSize->16]},ImageSize->300],"             ",Style["Sine Rule: \!\(\*FractionBox[\(a\), \(sin\\ A\)]\) = \!\(\*FractionBox[\(b\), \(sin\\ B\)]\) = \!\(\*FractionBox[\(c\), \(sin\\ C\)]\)",FontSize-> 30]}]

Examples

(Row[a.    ,       b.,           c.])

({{({{a. (a/(sin A))=(b/(sin B))}, {(m/(sin 65))=(5.8/(sin 60))}, {m=(5.8/(sin 60))×sin 65}, {=6.1}})}})

({{({{b.        N=180-54-38}, {=88°}, {(a/(sin A))=(b/(sin B))}, {(n/(sin 88))=(8.1/(sin 54))}, {n=(8.1/(sin 54))×sin 88}, {=10}})}})

({{({{c. ((sin A)/a)=((sin B)/b)}, {((sin θ)/6.3)=((sin 110)/8.5)}, {sin θ=((sin 110)/8.5)×6.3}, {=0.696}, {θ=(sin^(-1))(0.696)}, {=44.1°}})}})

You can utilise Mathematica’s Solve function to simplify the process: Example a

Solve[(m/(Sin[65°]))==(5.8/(Sin[60°])),m]

The Ambiguous Case

The information given can actually lead to a situation called the ambiguous case, where there is more than one possible solution. If we weren’t given a diagram showing the relative shape of the triangle then the same information could give us two different triangles. Consider:

Triangle ABC where A = 45°, a = 6.3 and b = 8.5 could be drawn in two ways.

or

The bold lines show one triangle, the dashed lines show the other option that still uses the same values.

The difference between the two angles is ϕ = 180 - θ

Cosine Rule

For a given triangle ABC:

(Row[,               , (Row[Cosine Rule: , (c^2)==(a^2)+(b^2)-2 a b cos(C)])])

Examples

(Row[a.    ,       b.,           c.])

({{({{a.      (c^2)=(a^2)+(b^2)-2a b cos(C)}, {(y^2)=(10.4^2)+(8.1^2)-2×10.4×8.1×cos(38)}, {=41.0059}, {∴y=(Sqrt[41.0059])}, {=6.4}})}})

({{({{b.       (c^2)=(a^2)+(b^2)-2a b cos(C)}, {(5.8^2)=(x^2)+(6^2)-2×x×6×cos(65)}, {33.64=(x^2)-5.07142x+36}, {0=(x^2)-5.07142x+2.36}, {∴x=0.518329 or 4.55309     (ambiguous case)}})}})

From the diagram we can see the value we are interested in is x=4.6

({{({{c.      (c^2)=(a^2)+(b^2)-2a b cos(C)}, {(6.3^2)=(4^2)+(8.5^2)-2×4×8.5×cos(θ)}, {cos(θ)=(((4^2)+(8.5^2)-(6.3^2))/(2×4×8.5))}, {cos(θ)=0.714118}, {∴ θ=44.4°}})}})

Mathematica: Example b

Solve[(5.8^2)==(x^2)+(6^2)-2 x 6 Cos[65°],x]

Mathematica Reminders

Exact Value

Mathematica works with exact values, unlike your calculator: (this feature becomes very handy in a couple of lesson’s time)

Sin[60 Degree]

We can use the ° symbol instead of the word: (it’s on the Classroom Assistant Palette)

Sin[60°]

When using a variable for the angle put a space between it and the degrees symbol:

Cos[B °]

Using Mathematica for the Sine Rule

We can use the Solve function to find the missing angle: Be careful! Solve uses a double equals.

Solve[(4/(Sin[A °]))==(7/(Sin[80°])),A]

To get an answer you understand express at least one side length in decimal form:

Solve[(4.0/(Sin[A °]))==(7/(Sin[80°])),A]

We can use DMSString to write the answer in Degrees Minutes Seconds:

DMSString[34.246]

This example finds a missing length:

Solve[(5.0/(Sin[30°]))==(b/(Sin[80°])),b]

What about the ambiguous case? Mathematica gives the smaller angle (same as your calculator):

Solve[(10.0/(Sin[A °]))==(6/(Sin[30°])),A]

Cosine Rule

We can use Solve again to find the missing values (remember to put one side in decimal form):

Solve[(c^2)==(6.0^2)+(10^2)-2 6 10 Cos[76°],c]

Solve[(4^2)==(9.0^2)+(7^2)-2 9 7 Cos[A °],A]

Sine & Cosine Rule Exercises

Solve the unknown sides and angles for the following triangles using the Sine and Cosine Rule

Angles given indicate the interior angle, they are simply on the outside for formatting convenience.

Drawings are to scale.

Manipulate[
Pane[Quiz1[NumberOfProblems1],Alignment->{Center,Center}],
{{NumberOfProblems1,9,"number of problems"},{6,9,12},ControlType->RadioButtonBar},
AutorunSequencing->{2},SaveDefinitions->True,
Initialization:>{
Quiz1[probs1_]:=TabView[Table[
allproblems1={
{twostep1,Style[Table[
ptA={RandomInteger[{1,4}],RandomInteger[{1,4}]};
ptB={RandomInteger[{6,10}],RandomInteger[{1,4}]};
ptC={RandomInteger[{1,10}],RandomInteger[{6,9}]};
Quiet[While[(ptA[[2]]-ptB[[2]])/(ptA[[1]]-ptB[[1]])==(ptA[[2]]-ptC[[2]])/(ptA[[1]]-ptC[[1]]),ptA={RandomInteger[{1,9}],RandomInteger[{1,9}]}]];
a=(Sqrt[(((ptC[[1]]-ptB[[1]]))^2)+(((ptC[[2]]-ptB[[2]]))^2)]);
b=(Sqrt[(((ptC[[1]]-ptA[[1]]))^2)+(((ptC[[2]]-ptA[[2]]))^2)]);
c=(Sqrt[(((ptA[[1]]-ptB[[1]]))^2)+(((ptA[[2]]-ptB[[2]]))^2)]);
α=ArcCos[((c^2)+(b^2)-(a^2))/(2 c b)];
β=ArcCos[((c^2)+(a^2)-(b^2))/(2 a c)];
γ=ArcCos[((a^2)+(b^2)-(c^2))/(2 a b)];
side=Style[Text[Round[c,0.1],{0,-0.5}+(ptA+ptB)/2],FontSize->14];
rand1=RandomChoice[{Style[Text[Round[b,0.1],{-0.5,0}+(ptA+ptC)/2],FontSize->14],
Style[Text[Round[a,0.1],{0.5,0}+(ptB+ptC)/2],FontSize->14],
Style[Text[Round[b,0.1],{-0.5,0}+(ptA+ptC)/2],FontSize->14],
Style[Text[Round[γ 180/π],{0,0.4}+ptC],FontSize->14],
Style[Text[Round[β 180/π],{0.4,0}+ptB],FontSize->14],
Style[Text[Round[α 180/π],{-0.4,0}+ptA],FontSize->14]}];
rand2=RandomChoice[{
Style[Text[Round[a,0.1],{0.5,0}+(ptB+ptC)/2],FontSize->14],
Style[Text[Round[b,0.1],{-0.5,0}+(ptA+ptC)/2],FontSize->14],
Style[Text[Round[γ 180/π],{0,0.4}+ptC],FontSize->14],
Style[Text[Round[β 180/π],{0.4,0}+ptB],FontSize->14],
Style[Text[Round[α 180/π],{-0.4,0}+ptA],FontSize->14]}];
While[rand2==rand1,rand2=RandomChoice[{
Style[Text[Round[a,0.1],{0.5,0}+(ptB+ptC)/2],FontSize->14],
Style[Text[Round[b,0.1],{-0.5,0}+(ptA+ptC)/2],FontSize->14],
Style[Text[Round[γ 180/π],{0,0.4}+ptC],FontSize->14],
Style[Text[Round[β 180/π],{0.4,0}+ptB],FontSize->14],
Style[Text[Round[α 180/π],{-0.4,0}+ptA],FontSize->14]}]];
rand3=RandomChoice[{
Style[Text[Round[a,0.1],{0.5,0}+(ptB+ptC)/2],FontSize->14],
Style[Text[Round[b,0.1],{-0.5,0}+(ptA+ptC)/2],FontSize->14],
Style[Text[Round[γ 180/π],{0,0.4}+ptC],FontSize->14],
Style[Text[Round[β 180/π],{0.4,0}+ptB],FontSize->14],
Style[Text[Round[α 180/π],{-0.4,0}+ptA],FontSize->14]}];
While[rand3==rand1||rand3==rand2,rand3=RandomChoice[{
Style[Text[Round[a,0.1],{0.5,0}+(ptB+ptC)/2],FontSize->14],
Style[Text[Round[b,0.1],{-0.5,0}+(ptA+ptC)/2],FontSize->14],
Style[Text[Round[γ 180/π],{0,0.4}+ptC],FontSize->14],
Style[Text[Round[β 180/π],{0.4,0}+ptB],FontSize->14],
Style[Text[Round[α 180/π],{-0.4,0}+ptA],FontSize->14]}]];
If[rand3===Style[Text[Round[a,0.1],{0.5,0}+(ptB+ptC)/2],FontSize->14],rand3=Style[Text["a",{0.5,0}+(ptB+ptC)/2],FontSize->14],If[rand3===Style[Text[Round[b,0.1],{-0.5,0}+(ptA+ptC)/2],FontSize->14],rand3=Style[Text["b",{-0.5,0}+(ptA+ptC)/2],FontSize->14],
If[rand3===Style[Text[Round[γ 180/π],{0,0.4}+ptC],FontSize->14],rand3=Style[Text["γ",{0,0.4}+ptC],FontSize->14],
If[rand3===Style[Text[Round[β 180/π],{0.4,0}+ptB],FontSize->14],rand3=Style[Text["β",{0.4,0}+ptB],FontSize->14],rand3=Style[Text["α",{-0.4,0}+ptA],FontSize->14]]]]];

prob1[i_]:=Graphics[{White,EdgeForm[Thickness[0.01]],Polygon[{ptA,ptB,ptC}],Blue,side,rand1,rand2,rand3
},ImageSize->200];
{Row[{"","  ",TraditionalForm[temp1=prob1[n]]}],"   ",Row[{"a = ",Round[a,0.1],", b = ",Round[b,0.1],", c = ",Round[c,0.1],", A = ",Round[α 180/π],", B = ",Round[β 180/π],", C = ",Round[γ 180/π]}]},
{n,1,probs1}],
14,FontFamily->"Times"],"Trigonometry"}
};

problist1=Select[allproblems1,(First[#1]==twostep1)&][[1,2]];
title1=Select[allproblems1,(First[#1]==twostep1)&][[1,3]];

Row[{"Form ",CharacterRange["A","Z"][[form1]]}]->TabView[{"Questions"->Column[{Style[Row[{title1," (Form ",CharacterRange["A","Z"][[form1]],")"}],16,Bold,"Label"],Style[Grid[Partition[Table[problist1[[1,i,1]],{i,1,Length[problist1[[1]]]}],3],Alignment->Left,
Spacings->{"Rows"->{2,{3},0},"Columns"->3}],14,FontFamily->"Times"],""},Spacings->2],
"Answers"->Column[{Style[Row[{title1," (Form ",CharacterRange["A","Z"][[form1]],")",Style["  Answer Key",Blue]}],12,Bold,"Label"],Style[Grid[Partition[Table[Column[{problist1[[1,i,1]],Style[problist1[[1,i,3]],Blue]}],{i,1,Length[problist1[[1]]]}],3],Alignment->Left,Spacings->{"Rows"->{1,{2},0},"Columns"->3}],12,FontFamily->"Times"]
},Spacings->2]
}],{form1,1,3}]];
}]

Sine Rule and Cosine Rule Functions

The following functions have been created to use the Sine or Cosine Rule to solve for an unknown side or angle when given the other pieces of information.

For the Sine Rule function enter the information in the form:

SineRule["side a","angle A","side b","angle B"]

For the Cosine Rule function enter the information in the form:

CosineRule["side a","side b", "side c", "angle C"]

Execute both functions below (⇧+⌤) :

SineRule[a_,A_,b_,B_]:=If[a ===x ||b===x,N[Solve[a/Sin[A]==b/Sin[B],x]][[1,1,2]],Row[{Quiet[N[Solve[a/Sin[A]==b/Sin[B],x][[1,1,2]] 180/π]],°}]]

CosineRule[a_,b_,c_,C_]:=If[C===x,Quiet[N[Solve[(c^2)==(a^2)+(b^2)-(2a b Cos[C ]),x]][[2,1,2]] 180/π],N[Solve[(c^2)==(a^2)+(b^2)-(2a b Cos[C ]),x]][[2,1,2]] ]

Execute the examples below:

SineRule[24.5,80°,x,40°]

SineRule[24.5,80°,16,x]

CosineRule[2000,1800,x,125°]

CosineRule[2000,1800,3372,x]